//将request.js整体导入
import request from './request';

//按需导出每个请求
export function post (url, params){
    params = params || {};
    return new Promise((resolve, reject) => {
        request.post(url, params).then((res) => {
            resolve(res);//  成功
        }).catch(err => {
            console.log("网络错误", err)
        })
    })
}
/**
 * get请求方式
 */
export function get (url, params) {
    params = params || {};
    return new Promise((resolve, reject) => {
        request.get(url, params).then((res) => {
            resolve(res);  //  成功
        }).catch((err) => {
            console.log("网络错误", err);
        })
    })
}
export default {
    get,
    post,
}
